package chan.project.aimodule.Service;

import jakarta.annotation.Resource;
import org.springframework.kafka.core.KafkaTemplate;
import org.springframework.stereotype.Service;

@Service
public class MessageProducerKafka {

    @Resource
    private KafkaTemplate<String, String> kafkaTemplate;

    public static final String LEGAL_TOPIC = "legal-topic";
    public static final String INSTRUMENT_TOPIC = "instrument-topic";

    /**
     * 发送法律法规消息
     */
    public void sendLegalMessage(String message) {
        kafkaTemplate.send(LEGAL_TOPIC, message);
        System.out.println("Sent to legal topic: " + message);
    }

    /**
     * 发送法律文书消息
     */
    public void sendInstrumentMessage(String message) {
        kafkaTemplate.send(INSTRUMENT_TOPIC, message);
        System.out.println("Sent to instrument topic: " + message);
    }
}
